package com.softer.ztb.mapper;

import com.softer.ztb.entity.SysMenu;
import com.softer.ztb.entity.SysRole;
import com.softer.ztb.entity.SysUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Set;
/**
 * LoginMapper class
 * @author zcz
 * @date 2019/1/16
 */
@Mapper
@Repository
public interface LoginMapper {
     /**
      * d登录时查询用户
      * @param userName
      * @return
      */
     SysUser findByUsername(@Param("userName") String userName);

     /**
      * 更新最近登陆时间
      * @param userName
      * @return
      */
     int updateLastLoginTime(@Param("userName") String userName);

     /**
      * 查询用户角色
      * @param userName
      * @return
      */
     Set<SysRole> findRoleByUsername(@Param("userName") String userName);

     /**
      * 查询角色菜单
      * @param roleId
      * @return
      */
     Set<SysMenu> findPermissionByRoleId(@Param("roleId") Integer roleId);
}
